<template>
  <div class="app-container">
    <el-row style="width: 100%;height: 100%;margin: 0;" :gutter="10">
      <!--区域数据-->
      <el-col :span="4" style="height: 100%;">
        <div style="background-color: #FFFFFF;height: 100%;padding: 10px;">
          <el-input placeholder="输入关键字进行过滤" clearable size="mini" suffix-icon="el-icon-search"
                    style="width: 100%;" v-model="filterText"/>
          <div style="height: 96%; max-height:96%;overflow-y: auto;margin-top: 10px;" class="treeCont">
            <el-tree
              :check-strictly="true"
              :data="sheetsTreeList"
              :props="defaultProps"
              :expand-on-click-node="false"
              :filter-node-method="filterNode"
              ref="tree"
              node-key="sheetsCode"
              :default-expanded-keys="defaultExpandedKeys"
              highlight-current
              v-loading="treeLoading"
              show-checkbox
              @check="getCollectorList"
            >
              <template #default="{ node, data}">
                <div class="custom-tree-node"
                     style="display: flex;justify-content: center;align-items: center;font-size: 14px;">
                  <span class="iconfont icon-a-jiafangzijianzhu icon-padding" v-if="data.deviceType === 0"></span>
                  <span class="iconfont icon-loudong icon-padding" v-if="data.deviceType === 1"></span>
                  <span class="iconfont icon-a-homezhuyefangzijia icon-padding" v-if="data.deviceType === 2"></span>
                  <span>{{ node.label }}</span>
<!--                  <span v-if="data.deviceCount!=null" class="device-count">{{data.deviceCount}}</span>-->
                </div>
              </template>
            </el-tree>
          </div>
        </div>
      </el-col>

      <el-col :span="20" style="height: 100%;background-color: #FFFFFF;">
        <div style="width: 100%;height: 100%;margin: 10px 5px 10px 0;">
          <el-row class="line-bottom" v-show="showSearch">
            <el-col class="form_col">
              <el-form :model="queryParams" ref="queryForm" :size="size" v-show="showSearch"
                       :label-width="labelWidth">
                <div id="searchFilter" style="display: flex; flex-wrap: wrap">
                  <el-form-item label="集中器名称" prop="concentratorId">
                    <el-select filterable v-model="collectorParams.concentratorId" placeholder="请选择集中器" clearable>
                      <el-option v-for="(item, index) of concentratorList" :key="index" :label="item.concentratorName"
                                 :value="item.id"></el-option>
                    </el-select>
                  </el-form-item>
                  <el-form-item label="集中器地址" prop="concentratorAddress">
                    <el-input size="mini"
                              v-model="collectorParams.concentratorAddress"
                              placeholder="请输入集中器地址"
                              clearable
                              @change="getCollectorList"
                              @keyup.enter="getCollectorList"
                    />
                  </el-form-item>
                  <el-form-item label="采集器名称" prop="collectorName">
                    <el-input size="mini"
                              v-model="collectorParams.collectorName"
                              placeholder="请输入采集器名称"
                              clearable
                              @change="getCollectorList"
                              @keyup.enter.native="getCollectorList"
                    />
                  </el-form-item>
                  <el-form-item label="采集器地址" prop="collectorAdd">
                    <el-input size="mini"
                              v-model="collectorParams.collectorAdd"
                              placeholder="请输入采集器地址"
                              clearable
                              @change="getCollectorList"
                              @keyup.enter.native="getCollectorList"
                    />
                  </el-form-item>

                </div>
              </el-form>
            </el-col>

            <el-col class="form_query">
              <el-button v-show="collapseAble" type="text" @click="shiftCollapseAble" class="text">
              <span>
                {{ fold ? '收起筛选' : '更多筛选' }}
              </span>
              </el-button>
              <el-button type="primary" icon="el-icon-search" size="mini" @click="getCollectorList">搜索</el-button>
              <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
            </el-col>
          </el-row>

          <el-row :gutter="10" class="mb8">
            <el-col :span="1.5">
              <el-button
                type="primary"
                plain
                icon="el-icon-plus"
                size="mini"
                @click="handleAdd"
                v-has-permi="['basedata:collector:add']"
              >新增
              </el-button>
            </el-col>
            <el-col :span="1.5">
              <el-button
                type="primary"
                plain
                icon="el-icon-upload2"
                size="mini"
                v-has-permi="['basedata:collector:import']"
                @click="handleImport"
              >导入
              </el-button>
            </el-col>
            <RightDropdown :columns="columns" :showSearch.sync="showSearch" :uploadVisible="uploadVisible"
                           @export="handleExport" @upload="handleUpload"
                           :hasPermiExport="['basedata:usersxb:export']" hasPermiUpload="['basedata:collector:exportTemplate']"></RightDropdown>
          </el-row>

          <el-table v-loading="loading" :data="collectorList" size="mini"
                    :height="getAvailableTableHeight" border ref="table">
            <el-table-column label="集中器地址" align="center" prop="concentratorAddress"
                             :show-overflow-tooltip="true"/>
            <el-table-column label="集中器名称" align="center" prop="concentratorName"
                             :show-overflow-tooltip="true"/>
            <el-table-column label="采集器ID" align="center" prop="id"
                             :show-overflow-tooltip="true"/>
            <el-table-column label="采集器名称" align="center" prop="collectorName"
                             :show-overflow-tooltip="true"/>
            <el-table-column label="采集器地址" align="center" prop="collectorAdd"
                             :show-overflow-tooltip="true"/>
            <el-table-column label="采集器序号" align="center" prop="collectorNo"
                             :show-overflow-tooltip="true"/>
            <el-table-column label="供电类型" align="center" prop="electricType"
                             :show-overflow-tooltip="true"/>
            <el-table-column label="通讯方式" align="center" prop="communicationMode"
                             :show-overflow-tooltip="true"/>
            <el-table-column label="多通道采集器" align="center" prop="multiPass"
                             :show-overflow-tooltip="true">
              <template slot-scope="scope">
                <dict-tag :options="dict.type.yes_no" :value="scope.row.multiPass"/>
              </template>
            </el-table-column>
            <el-table-column label="抄表频率" align="center" prop="readingFrequency"
                             :show-overflow-tooltip="true">
              <template slot-scope="scope">
                <dict-tag :options="dict.type.collect_frequency" :value="scope.row.readingFrequency"/>
              </template>
            </el-table-column>
            <el-table-column label="操作" align="center" prop="Feedback"
                             :show-overflow-tooltip="true" width="180">
              <template slot-scope="scope">
                <el-button type="warning" size="mini" @click="handleEdit(scope.row)" v-hasPermi="['basedata:collector:edit']">修改</el-button>
                <el-button type="danger" size="mini" @click="handleDelete(scope.row)" v-hasPermi="['basedata:collector:remove']">删除</el-button>
              </template>
              <!-- <el-button type="primary" size="mini">详细</el-button> -->
            </el-table-column>
          </el-table>
          <pagination
            :total="total"
            :page.sync="collectorParams.pageNum"
            :limit.sync="collectorParams.pageSize"
            @pagination="getList"
          />
        </div>
      </el-col>
    </el-row>

    <!-- 添加或修改采集器管理对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="720px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" :label-width="labelWidth" :inline="true">
        <el-form-item label="集中器名称" prop="concentratorId">
          <el-select v-model="form.concentratorId" placeholder="请选择集中器" style="width: 202px" clearable
                     @change="concentratorChange">
            <el-option v-for="(item, index) of concentratorList" :key="index" :label="item.concentratorName"
                       :value="item.id"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="采集器名称" prop="collectorName">
          <el-input v-model="form.collectorName" placeholder="请输入采集器名称"/>
        </el-form-item>
        <el-form-item label="采集器地址" prop="collectorAdd">
          <el-input v-model="form.collectorAdd" placeholder="请输入采集器地址"/>
        </el-form-item>
        <el-form-item label="采集器序号" prop="collectorNo">
          <el-input v-model.number="form.collectorNo" placeholder="请输入采集器序号"/>
        </el-form-item>
        <el-form-item label="供电类型" prop="electricType">
          <el-input v-model="form.electricType" placeholder="请输入供电类型"/>
        </el-form-item>
        <el-form-item label="边界值" prop="boundaryValue">
          <el-input v-model="form.boundaryValue" placeholder="请输入边界值"/>
        </el-form-item>
        <el-form-item label="通讯方式" prop="communicationMode">
          <el-input v-model="form.communicationMode" placeholder="请输入通讯方式"/>
        </el-form-item>
        <el-form-item label="多通道采集器" prop="multiPass">
          <el-select v-model="form.multiPass" placeholder="是否多通道采集器" style="width: 202px" clearable>
            <el-option v-for="(item, index) of dict.type.yes_no" :key="index" :label="item.label"
                       :value="item.value"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="抄表频率" prop="readingFrequency">
          <el-select v-model="form.readingFrequency" placeholder="请选择抄表频率" style="width: 202px" clearable>
            <el-option v-for="(item, index) of dict.type.collect_frequency" :key="index" :label="item.label"
                       :value="parseInt(item.value)"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input v-model="form.remark" placeholder="请输入备注"/>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
    <!-- 导入对话框 -->
    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
      <el-upload
        ref="upload"
        :limit="1"
        accept=".xlsx, .xls"
        :headers="upload.headers"
        :action="upload.url + '?updateSupport=' + upload.updateSupport"
        :disabled="upload.isUploading"
        :on-progress="handleFileUploadProgress"
        :on-success="handleFileSuccess"
        :auto-upload="false"
        drag
      >
        <i class="el-icon-upload"></i>
        <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
        <div class="el-upload__tip text-center" slot="tip">
<!--          <div class="el-upload__tip" slot="tip">-->
<!--            <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据-->
<!--          </div>-->
          <span>仅允许导入xls、xlsx格式文件。</span>
          <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="handleUpload" v-has-permi="['basedata:collector:exportTemplate']">下载模板</el-link>
        </div>
      </el-upload>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitFileForm">确 定</el-button>
        <el-button @click="upload.open = false">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {
  listConcentrator,
} from "@/api/record/concentrator";
import {
  listCollector,
  addCollector,
  editCollector,
  removeCollector
} from "@/api/record/collector";
import Treeselect from "@riophae/vue-treeselect";
import "highlight.js/styles/github-gist.css";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import {getToken} from "@/utils/auth";
import RegisterDialog from "@/views/record/metered/component/registerDialog.vue";


export default {
  name: 'Collector',
  dicts: ['concentrator_command_type', 'collect_frequency', 'terminal_supplier', 'frequency_meter_read', 'yes_no', 'module_type', 'reader_cycle', 'used_status', 'concentrator_supplier'],
  components: {
    Treeselect, RegisterDialog
  },
  data() {
    return {
      defaultExpandedKeys: [],
      collectorList: [],
      tabPosition: 'left',
      size: 'mini',
      uploadVisible: true,
      /* // 表单参数
       form: [],*/
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      labelWidth: '110px',
      // 集中器下拉框
      concentratorOption: [],
      // 时间
      sendTimeValue: [],
      selectedconcentratorNo: null,
      // 遮罩层
      loading: true,
      screenHeight: null,
      treeLoading: false,
      tableLoading: false,
      // 区域树选项
      sheetsTreeList: [],
      // 集中器管理表格数据
      concentratorList: [],
      // 协议下拉框
      listConcentrator: [],
      terminalxbList: [],
      // 显示搜索条件
      showSearch: true,
      collapseAble: false,
      fold: false,
      maxShow: '4',
      // 列信息
      defaultProps: {
        children: "children",
        label: "sheetsName",
      },
      total: 0,
      queryParams: {
        pageNum: 1,
        pageSize: 20,
        sheetsCode: '',
        concentratorName: null,
        concentratorId: null,
        tenantId: null,
        terminalId: null,
        // concentratorIds: null,
      },
      collectorParams: {
        pageNum:1,
        pageSize:20,
        concentratorAddress: '',
        concentratorId: '',
        collectorName: '',
        collectorAdd: '',
        concentratorIds: ''
      },
// 导入参数
      upload: {
        // 是否显示弹出层（用户导入）
        open: false,
        // 弹出层标题（用户导入）
        title: "",
        // 是否禁用上传
        isUploading: false,
        // 是否更新已经存在的用户数据
        updateSupport: 0,
        // 设置上传的请求头部
        headers: {Authorization: "Bearer " + getToken()},
        // 上传的地址
        url: process.env.VUE_APP_BASE_API + "/basedata/collector/importData"
      },
      filterText: '',
      filterConcentrator: '',
      // 右侧横向tab默认选中
      activeName: '1',
      selectedConcentrator: {},
      selectedconcentratorId: null,
      // 表单
      form: {
        id: null,
        tenantId: null,
        sheetsCode: null,
        concentratorId: null,
        collectorName: '',
        collectorAdd: null,
        collectorNo: null,
        electricType: null,
        boundaryValue: null,
        communicationMode: null,
        multiPass: null,
        readingFrequency: null,
        remark: null
      },
      // 表单校验
      rules: {
        // tenantId: [
        //   { required: true, message: "设备归属水司不能为空", trigger: "blur" }
        // ],
        concentratorId: [
          {required: true, message: "集中器地址不能为空", trigger: "blur"}
        ],
        collectorAdd: [
          {required: true, message: "采集器地址不能为空", trigger: "blur"}
        ],
        collectorName: [
          {required: true, message: "采集器名称不能为空", trigger: "blur"}
        ]
      },
      // 列信息
      columns: [
        {key: 0, label: `集中器地址`, visible: true},
        {key: 1, label: `采集器名称`, visible: true},
        {key: 2, label: `采集器地址`, visible: true},
        {key: 3, label: `采集器序号`, visible: true},
        {key: 4, label: `安装位置`, visible: true},
        {key: 5, label: `供电类型`, visible: true},
        {key: 6, label: `边界值`, visible: true},
        {key: 7, label: `通讯方式`, visible: true},
        {key: 8, label: `多通道采集器`, visible: true},
        {key: 9, label: `抄表频率`, visible: true},
        {key: 10, label: `备注`, visible: true},
      ],
    }
  },
  methods: {
    getCollectorList() {
      this.queryParams.pageNum = 1
      this.concentratorList = []
      this.loading = true;
      this.getList()
    },
    /** 转换部门数据结构 */
    normalizer(node) {
      if (node.children && !node.children.length) {
        delete node.children;
      }
      return {
        id: '' + node.sheetsCode,
        label: node.sheetsName,
        children: node.children
      };
    },
    /** 查询区域树 */
    getTreeList() {
      this.treeLoading = true;
      this.sheetsTreeList = JSON.parse(localStorage.getItem('meteredTreeData'))
      if (this.sheetsTreeList.length === 0) {
        this.treeLoading = false;
      } else {
        this.defaultExpandedKeys = [this.sheetsTreeList[0].sheetsCode];
        this.treeLoading = false;
      }
    },
    concentratorChange(e) {
      this.concentratorList.filter(item => {
        if (item.id === e) {
          this.form.concentratorAddress = item.concentratorId
        }
      })
    },
    /** 查询集中器管理列表 */
    getList() {
      this.queryParams.sheetsCode = this.$refs.tree.getCheckedKeys().join(',');
      listConcentrator(this.queryParams).then(response => {
        this.concentratorList = [...this.concentratorList, ...response.rows];
        if (response.total > this.queryParams.pageSize * this.queryParams.pageNum) {
          this.queryParams.pageNum += 1
          this.getList()
        }else{
          this.collectorParams.concentratorIds =  this.concentratorList.map(item => item.id).toString()
          listCollector(this.collectorParams).then(response => {
            this.collectorList = response.rows
            this.total = response.total
            this.loading = false;
          })
        }
      });
      // this.handleTabClick(tab);
    },

    handleNodeClick(data) {
      this.selectedConcentrator = data
      this.selectedconcentratorId = data.id
      this.selectedconcentratorNo = data.concentratorId
      this.getLogList()
    },

    /** 标签页选中操作 */
    handleTabClick(tab) {
      this.selectedconcentratorId = this.concentratorList[tab.index].id
      this.selectedconcentratorNo = this.concentratorList[tab.index].concentratorId
      this.getLogList()
    },

    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加采集器管理";
    },
    /** 修改按钮操作 */
    handleEdit(row) {
      this.form = row
      this.open = true;
      this.title = "修改采集器管理";
    },
    /** 删除操作按钮 */
    handleDelete(row) {
      const ID = row.id;
      this.$modal.confirm('是否确认删除集中器地址为"' + row.collectorAdd + '"的数据项？').then(function() {
        return removeCollector(ID)
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            editCollector(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addCollector(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        tenantId: null,
        sheetsCode: null,
        concentratorId: null,
        concentratorAddress: null,
        collectorName: '',
        collectorAddress: null,
        collectorNo: null,
        electricType: null,
        boundaryValue: null,
        communicationMode: null,
        multiPass: null,
        readingFrequency: null,
        remark: null
      };
      this.resetForm("form");

    },
    // 重置
    resetQuery() {
      this.resetChecked()
      this.collectorParams = {
        pageNum: 1,
        pageSize: 20,
        sheetsCode: '',
        concentratorName: null,
        concentratorId: null,
        tenantId: null,
        terminalId: null,
      }
      this.collectorParams = {
        concentratorId: '',
        collectorName: '',
        collectorAdd: '',
        concentratorIds: '',
        sheetsCode: '',
        concentratorAddress: '',
      }
      this.getCollectorList()
    },
    // 清空选中的区域
    resetChecked() {
      this.$refs.tree.setCheckedKeys([]);
    },
    // 筛选节点
    filterNode(value, data) {
      if (!value) return true;
      return data.name.indexOf(value) !== -1;
    },
    filterConcentratorNode(value, data) {
      if (!value) return true;
      return data.concentratorName.indexOf(value) !== -1;
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('basedata/collector/export', {
        ...this.collectorParams
      }, `采集器_${new Date().getTime()}.xlsx`)
    },
    // 展开折叠按钮
    shiftCollapseAble() {
      this.fold = !this.fold
      this.minShowControl()
    },
    // 通过maxShow控制元素显示/折叠
    minShowControl() {
      const group = window.document.querySelectorAll(`#searchFilter .el-form-item.el-form-item--${this.formItemSize}`)
      const len = group?.length ? group?.length : 0
      if (this.maxShow < len) {
        group.forEach((item, index) => {
          if (index > this.maxShow - 1 && index < len) {
            item.hidden = !this.fold
          }
        })
        this.collapseAble = true
      } else {
        this.collapseAble = false
      }
    },
    // 下载模板
    handleUpload() {
      this.download('basedata/collector/exportTemplate', {}, `采集器模板_${new Date().getTime()}.xlsx`)
    },
    /** 导入按钮操作 */
    handleImport() {
      this.upload.title = "采集器导入";
      this.upload.open = true;
    },
    // 文件上传中处理
    handleFileUploadProgress(event, file, fileList) {
      this.upload.isUploading = true;
    },
    // 文件上传成功处理
    handleFileSuccess(response, file, fileList) {
      this.upload.open = false;
      this.upload.isUploading = false;
      this.$refs.upload.clearFiles();
      this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", {dangerouslyUseHTMLString: true});
      this.getList();
    },
    // 提交上传文件
    submitFileForm() {
      this.$refs.upload.submit();
    },
  },
  created() {
    this.screenHeight = document.body.clientHeight
  },
  computed: {
    // getAvailableHeight() {
    //   const height = (this.screenHeight - 220) + 'px'
    //   return {maxHeight: height, minHeight: height}
    // },
    getAvailableTableHeight() {
      return this.screenHeight - 255
    }
  },
  watch: {
    filterText(val) {
      this.$refs.tree.filter(val);
    },
    filterConcentrator(val) {
      this.$refs.concentratorTree.filter(val);
    },
    sendTimeValue(newVal) {
      if (newVal == null) {
        this.sendTimeValue = []
        this.logQueryParams.params = {
          beginSendTime: null,
          endSendTime: null
        }
      }
    }
  },
  mounted() {
    this.getTreeList()
    // this.getList()
    this.getCollectorList()
  }
}
</script>

<style scoped lang="scss">
.content-wrapper {
  margin-bottom: 16px;
}

.content-margin {
  margin-bottom: 16px;
}

.info-box {
  /* background-color: #F7FAFC; */
  width: 600px;
  height: 60px;
  padding: 10px 10px;
}

.el-tabs__item {
  width: 200px;
}

.clearfix:after {
  content: ' ';
  display: block;
  height: 0;
  clear: both;
}

.left {
  float: left;
}

.right {
  float: right;
}


.title {
  font-size: 18px;
  font-weight: bold;
  text-align: right;
  width: 200px;
}


::v-deep .el-descriptions-item__cell.el-descriptions-item__label.is-bordered-label {
  width: 110px;
  text-align: right;
  padding: 8px;
}

::v-deep .el-descriptions-item__cell.el-descriptions-item__content {
  min-width: 150px;
  padding: 8px;
}

// 设置本身箭头为隐藏状态
::v-deep .el-tree-node__expand-icon {
  width: 20px;
  padding: 0;
  margin: 5px 0;

  svg {
    display: none;
    width: 0;
  }
}

// 虚线所需样式
::v-deep .treeCont {
  .el-tree-node {
    width: fit-content;
  }

  .el-tree > .el-tree-node:before {
    //border-top: none;
    padding-left: 0px;
  }

  .el-tree > .el-tree-node:after {
    border-top: none;
  }

  .el-tree-node__content {
    padding-left: 5px !important;
  }

  .el-tree-node__children {
    //overflow: visible !important;
    .el-tree-node {
      position: relative;
      padding-left: 5px;
    }
  }

  //节点有间隙，隐藏掉展开按钮就好了,如果觉得空隙没事可以删掉
  .el-tree-node__expand-icon.is-leaf {
    width: 4px;
  }

  .el-tree-node__children {
    padding-left: 18px;
  }

  .el-tree-node :last-child:before {
    height: 17px;
  }

  .el-tree > .el-tree-node:before {
    border-left: none;
  }

  .el-tree > .el-tree-node:after {
    border-top: none;
    top: 25px;
    width: 0px;
  }

  .el-tree-node:before {
    content: "";
    left: -4px;
    position: absolute;
    right: auto;
    border-width: 1px;
  }

  .el-tree-node:after {
    content: "";
    left: -4px;
    position: absolute;
    right: auto;
    border-width: 1px;
  }

  .el-tree-node:before {
    border-left: 1px dashed #c0c4cc;
    height: 100%;
    top: -3px;
    width: 1px;
  }

  .el-tree-node:after {
    border-top: 1px dashed #c0c4cc;
    height: 0px;
    top: 13px;
    width: 16px;
  }
}

// 默认三角行换成加减号
::v-deep .treeCont {
  .el-tree-node__content > .el-tree-node__expand-icon {
    width: 16px;
    //width: 0px;
    padding: 0px;
    font-size: 16px !important;
    margin-right: 5px; //新增
  }

  .el-tree .el-tree-node__expand-icon.expanded {
    -webkit-transform: rotate(0deg);
    transform: rotate(0deg);
  }

  //有子节点 且未展开
  .el-tree .el-tree-node__expand-icon:before {
    background: url('../../../../assets/images/jia.png') no-repeat;
    content: "";
    display: block;
    width: 20px;
    height: 20px;
    font-size: 20px;
    background-size: 100% 100%;
  }

  .custom-tree-node .el-icon svg {
    display: block !important;
    color: #000;
  }

  //有子节点 且已展开
  .el-tree .el-tree-node__expand-icon.expanded:before {
    background: url('../../../../assets/images/jian.png') no-repeat;
    content: "";
    display: block;
    width: 20px;
    height: 20px;
    font-size: 20px;
    background-size: 100% 100%;
  }

  //没有子节点
  .el-tree .el-tree-node__expand-icon.is-leaf::before {
    background: none;
    content: "";
    display: block;
    width: 20px;
    height: 20px;
    font-size: 20px;
    background-size: 100% 100%;
  }
}

</style>
